<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%@page import="java.util.*"%>
<%@page import="dyyx.domain.*"%>
<%@page import="dyyx.*"%>

<%

   String q = request.getParameter("q");
   String maxRowsStr = request.getParameter("maxRows");
   int maxRows = CommUtil.getInt(maxRowsStr);
   if(maxRows<=0){
	   maxRows = 9;
   }
   SearchResult sr = LuceneUtil.doSearch(q, maxRows);

%>

<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title> search result </title>

</head>
q <%=q %> <br>
maxRows <%=maxRows %> <br>
num <%=sr.num%> <br>

<table width="90%" border=1>

<tr>
  <td>ID</td>
  <td>score</td>
  <td>path</td>
</tr>


<%for(Map item:sr.list) {%>

<tr>
  <td><a href='detail.jsp?id=<%=item.get("id")%>' target='_blank'><%=item.get("id") %></a></td>
  <td><%=item.get("score") %></td>
  <td><a href='detail.jsp?path=<%=item.get("path")%>' target='_blank'><%=item.get("path") %></a></td>
</tr>

<%}%>

</table>




</html>